package io.renren.modules.erp.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.common.utils.PageUtils;
import io.renren.modules.erp.entity.Account;
import io.renren.modules.erp.vo.AccountVo4InOutList;
import io.renren.modules.erp.vo.AccountVo4List;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface AccountService extends IService<Account> {

    Account getAccount(long id) throws Exception;
    List<Account> getAccountListByIds(String ids)throws Exception ;
    List<Account> getAccount() throws Exception;

    PageUtils select(String name, String serialNo, String remark, int currPage, int  pageSize) throws Exception;

    Long countAccount(String name, String serialNo, String remark)throws Exception ;
    int insertAccount(String beanJson, HttpServletRequest request)throws Exception ;
    int updateAccount(String beanJson, Long id, HttpServletRequest request)throws Exception ;
    int deleteAccount(Long id, HttpServletRequest request) throws Exception;
    int batchDeleteAccount(String ids, HttpServletRequest request)throws Exception ;

    int checkIsNameExist(Long id, String name)throws Exception ;

    List<Account> findBySelect()throws Exception ;
    BigDecimal getAccountSum(Long id, String timeStr, String type) throws Exception;
    BigDecimal getAccountSumByHead(Long id, String timeStr, String type) throws Exception;
    BigDecimal getAccountSumByDetail(Long id, String timeStr, String type)throws Exception ;
    BigDecimal getManyAccountSum(Long id, String timeStr, String type)throws Exception ;

    PageUtils findAccountInOutList(Long accountId, Integer currPage, Integer pageSize,BigDecimal initialAmount) throws Exception;

    int findAccountInOutListCount(Long accountId) throws Exception;
    int updateAmountIsDefault(Boolean isDefault, Long accountId) throws Exception;
    int batchDeleteAccountByIds(String ids,Long userId) throws Exception;
    int batchDeleteAccountByIdsNormal(String ids ,Long userId) throws Exception;
    Map<String, Object> getStatistics() ;
}
